<?php

require_once("Province.class.php");
require_once("db.php");

class Inland extends Province{

	function __construct($color, $name,& $defending_unit = null){
		global $db_connect;
		echo "New inland object created named <b>$name</b> with color <b>$color</b><br>"; //test-code

		parent::setColor($color);
		parent::setName($name);

		if($defending_unit != null){
			parent::setDefending_unit($defending_unit);
		}

		$qry = "INSERT INTO province(color, name) VALUES(?,?)";
		$stmt = $db_connect -> prepare($qry);
		$stmt -> bind_param('ss',$color,$name);
		$stmt -> execute();
	}

	
}
?>
